extends ./index.jade
include ./includes/alert.jade

block content
	.rightSide
		.container-fluid
			.row
				.col-sm-8.col-sm-offset-2.col-md-6.col-md-offset-2
					form.form-horizontal#addGoodsForm
						.form-group
							label.col-sm-3.text-right.control-label
								span.text-danger *
								|商品名称
							.col-sm-9
								input(type='text' id='goods_name' autofocus).form-control
						.form-group
							label.col-sm-3.text-right.control-label
								span.text-danger *
								|商品简介
							.col-sm-9
								textarea(type='text' id='goods_info' rows='5').form-control
						.form-group
							label.col-sm-3.text-right.control-label
								span.text-danger *
								|价格
							.col-sm-9
								input(type='number' id='goods_price' ).form-control
						.form-group
							label.col-sm-3.text-right.control-label
								span.text-danger *
								|商品图
							.col-sm-9
								img#preview
								label(for='goods_pic').btn.btn-default 选择图片
								input(type='file' id='goods_pic' accept="image/*").hide
								label#errorMessage.control-label 文件类型出错，请选择图片...
						.form-group
							.col-sm-offset-3
								+alert('addGoodsError')
						.form-group.text-center
							hr
							.col-sm-offset-3
								a(onclick='addGoods()').btn.btn-success 上架商品
								a(onclick='history.go(-1)').btn.btn-default 取消
	.modal.fade#addGoodsMessageModal
		.modal-dialog
			.modal-content
				.modal-body
					h4#addGoodsMessage 上架商品成功！
				.modal-footer
					a(onclick="location.replace(location.href)").btn.btn-success 继续上架商品
					a(onclick='history.go(-1)').btn.btn-default 返回商品管理


	script(src='/js/lib/require.js' data-main='/js/add_goods')
